from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
    mobile = models.CharField(max_length=11, unique=True)
    #需要pillow包的支持
    icon = models.ImageField(upload_to='icon', default='icon/default.jpg',blank=True)

    class Meta:
        #自定义数据库表名
        db_table = 'demo_user'
        #起别名便于orm
        verbose_name_plural = '用户表'

    def __str__(self):
        return self.username